<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ page isELIgnored="false"%>
	<%@ taglib uri="/struts-tags" prefix="s"%>
	<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>用户信息列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="${pageContext.request.contextPath}/styles/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.odd {
	margin:0 0 0 0;
	padding: 0.5em;
	background: blue;
}
table th, table td {border: none; color:#ffffff;}
</style>
</head>
<body>
<div class="main">

  <div class="slider2">
    <div class="slider4_resize">
      <h2>电影信息列表</h2>
    </div>
    <div class="clr"> </div>
  </div>
  <div class="clr"> </div>
  <div class="body">
    <div class="body_resize2">
      <p><strong></strong><br />
        </p>
       <s:actionerror />
     <table>
		<tr>
			<th>编号id</th>
			<th>电影名称</th>
			<th>电影类型</th>
			<th>影视状态</th>
			<th>操作</th>
		</tr>
        <c:forEach var="films" items="${requestScope.filmList}" varStatus="status">
			<!-- 隔行变色效果 -->
			<!-- 判断status.count是否为奇数,如果为奇数设置该行背景颜色为蓝色 -->
			<tr 
				<c:if test="${status.count % 2 == 1}">
					class = "odd"
				</c:if>
			>
				<td>${status.count}</td>
				<td>${films.fi_name}</td>
				<td><c:forEach var="filmtype" items="${films.film_type}">
				      /${filmtype.ty_name}
				    </c:forEach>
				</td>
				<c:if test="${films.fi_state==0}"><td>未上映</td></c:if>
				<c:if test="${films.fi_state==1}"><td>已上映</td></c:if>
				<c:if test="${films.fi_state==5}"><td>移通播放</td></c:if>
				
				<!-- 配置管理员的权限 -->
				<c:if test="${sessionScope.admin.us_type==0}">
				<td>
			<a href="
				<c:url value="admin_filim_information">
					<c:param name="film.fi_id" value="${films.fi_id}"/>
				</c:url>"
			>添加分类</a> &nbsp; 
			<a href="
				<c:url value="del_film">
					<c:param name="film.fi_id" value="${films.fi_id}"/>
				</c:url>"
			 	onclick="return confirm('确定删除电影?')"
			>删除</a>
			
			</td>
			</c:if>
			<c:if test="${sessionScope.admin.us_type!=0}">
			<td>你无权操作</td>
			</c:if>
			</tr>
			
		</c:forEach>
	</table>  
	<p>
		<!-- ======================分页超链接======================================= -->
				<!-- 判断事是否就一页信息 且为第一页 -->
				<c:if test="${(allPage-1)==offsetPage&&(offsetPage==0)}">
					<a href="#">末页</a>
				</c:if>
				<!-- 判断当前是最后一页 -->
				<c:if test="${((allPage-1)==offsetPage)&&(offsetPage!=0)}">
					<a
						href="
				<c:url value="getall_filmlist">
					<c:param name="offsetPage" value="${offsetPage-1}"/>
				</c:url>
		">上一页</a>
				</c:if>
				<!-- 判断事是否>一页信息 且为第一页 -->
				<c:if test="${((allPage-1)!=offsetPage)&&(offsetPage==0)}">
					<a
						href="
				<c:url value="getall_filmlist">
					<c:param name="offsetPage" value="${offsetPage+1}"/>
				</c:url>
		">下一页</a>
				</c:if>
				<!-- 判断事是否不是组后一页信息 且不为第一页 -->
				<c:if test="${((allPage-1)!=offsetPage)&&(offsetPage!=0)}">
					<a
						href="
				<c:url value="getall_filmlist">
					<c:param name="offsetPage" value="${offsetPage-1}"/>
				</c:url>
		">上一页</a>
					<a
						href="
				<c:url value="getall_filmlist">
					<c:param name="offsetPage" value="${offsetPage+1}"/>
				</c:url>
		">下一页</a>
				</c:if>
				<p>当前页码${offsetPage+1} 总页数${allPage}</p>
    </p>
    </div>
    <div class="clr"></div>
  </div>

</div>
</body>
</html>